

using System;
using System.Collections.Generic;
using System.Text;
using EntityLayer;
using System.Data;
using DataAccessLayer;

namespace DataLayer
{
	public class datPhotoContents
	{
		public datPhotoContents()
		{
		}
		
		#region  Code Factory Generated Methods
        public void DeletePhotoContentsByPhotoContentId(entPhotoContents parEntPhotoContents, DbConnector parDbConnector)
        {
            DbParamCollection insDbParamCollection = new DbParamCollection();
            insDbParamCollection.Add("@pPhotoContentId", parEntPhotoContents.PhotoContentId);
            parDbConnector.ExecuteNonQuery("DeletePhotoContentsByPhotoContentId", insDbParamCollection);
        }
        public void InsertPhotoContents(entPhotoContents parEntPhotoContents, DbConnector parDbConnector)
        {
            DbParamCollection insDbParamCollection = new DbParamCollection();
            insDbParamCollection.Add("@pPhotoId", parEntPhotoContents.PhotoId);
            insDbParamCollection.Add("@pLanguageId", parEntPhotoContents.LanguageId);
            insDbParamCollection.Add("@pPhotoName", parEntPhotoContents.PhotoName);
            insDbParamCollection.Add("@pPhotoDescription", parEntPhotoContents.PhotoDescription);
            insDbParamCollection.AddOutput("@pPhotoContentId", DbType.Int32);
            parDbConnector.ExecuteNonQuery("InsertPhotoContents", insDbParamCollection);
            parEntPhotoContents.PhotoContentId = Convert.ToInt32(insDbParamCollection.GetOutPutParameter().Value);
        }
        public void UpdatePhotoContentsByPhotoContentId(entPhotoContents parEntPhotoContents, DbConnector parDbConnector)
        {
            DbParamCollection insDbParamCollection = new DbParamCollection();
            insDbParamCollection.Add("@pPhotoContentId", parEntPhotoContents.PhotoContentId);

            insDbParamCollection.Add("@pPhotoId", parEntPhotoContents.PhotoId);
            insDbParamCollection.Add("@pLanguageId", parEntPhotoContents.LanguageId);
            insDbParamCollection.Add("@pPhotoName", parEntPhotoContents.PhotoName);
            insDbParamCollection.Add("@pPhotoDescription", parEntPhotoContents.PhotoDescription);
            parDbConnector.ExecuteNonQuery("UpdatePhotoContentsByPhotoContentId", insDbParamCollection);
        }
		#endregion
        public DataTable SelectPhotoContentsByPhotoId(entPhotoContents parEntPhotoContents, DbConnector parDbConnector)
        {
            DbParamCollection insDbParamCollection = new DbParamCollection();
            insDbParamCollection.Add("@pPhotoId", parEntPhotoContents.PhotoId);
            return parDbConnector.ExecuteDataTable("SelectPhotoContentsByPhotoId", insDbParamCollection);
        }
        public void DeletePhotoContentsByPhotoId(entPhotoContents parEntPhotoContents, DbConnector parDbConnector)
        {
            DbParamCollection insDbParamCollection = new DbParamCollection();
            insDbParamCollection.Add("@pPhotoId", parEntPhotoContents.PhotoId);
            parDbConnector.ExecuteNonQuery("DeletePhotoContentsByPhotoId", insDbParamCollection);
        }
	}
}